<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <h1>The Axios Ajax 01 Page</h1>
    <button onclick="doAxiosGet()">axios.gte()</button>
    <button onclick="doAxiosPost()">axios.post()</button>

    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>

    <script>
        function doAxiosGet() {
            axios.get('http://localhost:8080/doAjaxGet')
                .then(function (response) {
                    console.log(response.data);
                })
                .catch(function (error) {
                    console.log(error);
                });
        }

        function doAxiosPost() {
            axios.post('http://localhost:8080/doAjaxPost', {
                id: '101',
                name:'投影仪',
                remark: '答复'
            })
                .then(function (response) {
                    console.log(response);
                })
                .catch(function (error) {
                    console.log(error);
                });
        }

    </script>
</body>
</html>